home *** CD-ROM | disk | FTP | other *** search
- /*
- File: CAUIEvt.cpp
-
- Contains: Container Application Library source - UI events
-
- Written by: Rick Badertscher
-
- Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <17> 5/21/95 DHN Check cmd key in DispatchEvent rather than rely on MenuKey()
- <16> 5/19/95 SJF Add null events back into dispatching for embedded parts
- <10> 5/15/95 RB Adding CA_CATCH
- <9> 4/23/95 RB More mods to CADispatchEvent().
- <8> 4/22/95 RB Mods to CADispatchEvent()
- <7> 4/13/95 RB Implemented CAGetSleepTime() and CAGetMouseRgn()
- <6> 4/08/95 RB Fixed ref count problems in CADispatchEvent()
- <5> 3/30/95 RB Modified CADispatchEvent to preserve the
- untouched portion of the updateRgn during
- an update event.
-
- <4+> 2/28/95 SJF Add debug stuff to API calls
- <4> 2/13/95 SJF Interim checkin to update project database
- <3) 12/15/94 SJF change somGetGlobalEnvironment to _gpProxyShell->GetGlobalEnvironment
- <2> 10/30/94 GCA,DHN All mods to make project compile with no
- errors under OpenDoc b1 (with SOM).
- <1> 10/16/94 SJF first written
-
- To Do:
- */
-
- #ifndef _CASESSN_
- #include "CASessn.h"
- #endif
-
- #ifndef _CAERROR_
- #include "CAError.h"
- #endif
-
- #ifndef _CASDISPTCH_
- #include "CADisptch.h"
- #endif
-
- #ifndef SOM_ODSession_xh
- #include <ODSessn.xh>
- #endif
-
- #ifndef _ODUTILS_
- #include <ODUtils.h>
- #endif
-
- #ifndef SOM_ODDispatcher_xh
- #include <Disptch.xh>
- #endif
-
- #ifndef _CADEBUG_
- #include "CADebug.h"
- #endif
-
-
- #pragma segment CALib
-
- //-------------------------------------------------------------------------
- // UI Events ***
- //-------------------------------------------------------------------------
-
- pascal Boolean CADispatchEvent( EventRecord* event, CAEventInfo* eventInfo )
- {
-
- Boolean result;
-
- CA_TRY
-
- result = gCASession->GetCADispatcher()->DispatchEvent (event, eventInfo);
-
- CA_CATCH_ALL
- CA_ENDTRY
-
- return (result);
-
- }
-
-
-
-
- //-------------------------------------------------------------------------
- pascal RgnHandle CAGetMouseRegion( void )
- {
-
- Environment* ev = gCASession->GetEV();
- ODDispatcher* dispatcher = gCASession->GetODSession()->GetDispatcher(ev);
- RgnHandle aRgnHandle = kODNULL;
-
- CA_TRY
-
- aRgnHandle = dispatcher->GetMouseRegion (ev);
-
- CA_CATCH_ALL
- CA_ENDTRY
-
- return aRgnHandle;
-
- }
-
-
- //-------------------------------------------------------------------------
- pascal long CAGetSleepTime( void )
- {
- Environment* ev = gCASession->GetEV();
- ODDispatcher* dispatcher = gCASession->GetODSession()->GetDispatcher(ev);
- long result = 0;
-
- CA_TRY
-
- result = dispatcher->GetSleepTime (ev);
-
- CA_CATCH_ALL
- CA_ENDTRY
-
- return result;
- }
-
-
-